package com.study.anno;

import org.springframework.core.annotation.AliasFor;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.concurrent.TimeUnit;

/**
 * @author zhuzi
 * 2024/9/25 22:36
 * 限流
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface RateLimit {
    @AliasFor("qps")
    double value() default 0;

    @AliasFor("value")
    double qps() default 0;

    int timeout() default 0;

    TimeUnit timeUnit() default TimeUnit.MICROSECONDS;
}
